﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebCore.Models.DataEntities;
using WebCore.App_Start;

namespace WebCore.Models.DataManagers
{
    public enum ListItemGroupEnum
    {
        HeaderBanners , // 1.2
        HomeBanners, // 1.6
        HomeLeftAds, // 1.7,8
        HomeRightAds,
        HeaderLinks, // 1.1
        FooterLinks,
        NewBestBanners, 
        ProductGifts
    }

    public sealed class ListItemManager
    {
        public static List<ListItem> GetActiveListItems(ListItemGroupEnum groupEnum, string lang)
        {
            string groupString = groupEnum.ToString();
            DataEntities.DataEntities entities = new DataEntities.DataEntities();
            return (from d in entities.ListItems
                    where d.State == MyAppConfig.State_Active && d.Group == groupString && d.Lang == lang
                    orderby d.OrderNumber ascending
                    select d).ToList();
        }
    }
}